﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace Smart.Common
{
    public partial class ProgressForm : DevExpress.XtraEditors.XtraForm
    {
        public ProgressForm()
        {
            InitializeComponent();
        }

        public ProgressForm(Form parent)
        {
            this.components = null;
            this.InitializeComponent();
            if (parent != null)
            {
                base.Left = parent.Left + ((parent.Width - base.Width) / 2);
                base.Top = parent.Top + ((parent.Height - base.Height) / 2);
            }
            base.Height = (this.progressBarControl1.Height + (this.progressBarControl1.Top * 2)) + 4;
        }

        public ProgressForm(UserControl parent)
        {
            this.components = null;
            this.InitializeComponent();
            if (parent != null)
            {
                base.Left = parent.Left + ((parent.Width - base.Width) / 2);
                base.Top = parent.Top + ((parent.Height - base.Height) / 2);
            }
            base.Height = (this.progressBarControl1.Height + (this.progressBarControl1.Top * 2)) + 4;
        }

        public void SetProgressValue(int position)
        {
            this.progressBarControl1.Position = position;
            base.Update();
        }
    }
}